//
//  MyPackageViewController.m
//  Manage
//
//  Created by 杨康 on 2018/1/10.
//  Copyright © 2018年 杨康. All rights reserved.
//

#import "MyPackageViewController.h"
#import "BuyPackageViewController.h"
@interface MyPackageViewController ()

@end

@implementation MyPackageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"我的套餐";
    
    
    
    UIView *noneView=[[UIView alloc]init];
    [self.view addSubview:noneView];
    [noneView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(TOP_HEIGHT);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT-TOP_HEIGHT));
    }];
    noneView.backgroundColor=[UIColor whiteColor];
    
    
    UIImageView *bgImageView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"登录背景图"]];
    [noneView addSubview:bgImageView];
    [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(noneView);
        
    }];
    
    
    
    UILabel *tipLab=[SingLeton myLabel:[UIColor colorWithHexString:@"222222"] andTitle:@"您还没有购买套餐。" andFont:16];
    [noneView addSubview:tipLab];
    [tipLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(bgImageView.mas_bottom).mas_offset(15);
        make.centerX.mas_equalTo(noneView);
    }];
    
    noneView.hidden=YES;
    
    
    
    
    UIImageView *packageImg=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"我的套餐背景"]];
    [self.view addSubview:packageImg];
    [packageImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH-40, (SCREEN_WIDTH-40)*36/67));
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(20+TOP_HEIGHT);
    }];
    
    
    UILabel *typeLab=[SingLeton myLabel:[UIColor colorWithHexString:@"09be00"] andTitle:@"按月套餐" andFont:24];
    typeLab.font=[UIFont boldSystemFontOfSize:24];
    [packageImg addSubview:typeLab];
    [typeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(20);
        
    }];
    
    UILabel *lostTimeLab=[SingLeton myLabel:[UIColor colorWithHexString:@"09be00"] andTitle:@"剩余12天" andFont:18];
    [packageImg addSubview:lostTimeLab];
    [lostTimeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(typeLab.mas_bottom).mas_offset(15);
        
    }];
    
    UILabel *endLab=[SingLeton myLabel:[UIColor colorWithHexString:@"222222"] andTitle:@"到期时间：2018年2月13日 23:59:59" andFont:10];
    [packageImg addSubview:endLab];
    [endLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.bottom.mas_equalTo(-15);
    }];
    
    
    YKButton *payButton=[SingLeton endButton:[UIColor colorWithHexString:@"09be00"] andTitle:@"购买套餐" RequestSuccess:^(UIButton *btn) {
        BuyPackageViewController *vc=[[BuyPackageViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
    }];
    [self.view addSubview:payButton];
    [payButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.bottom.mas_equalTo(-20);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH-40, 44));
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
